package com.module.ad.toutiao;

import android.app.Activity;
import android.content.Context;

import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk;

/**列表信息流广告*/
public class TTListAd {

    /**
     * 只加载图片
     */
    public static void loadListImgAd(Activity context, TTAdNative.NativeExpressAdListener listener) {
        //创建TTAdNative对象，createAdNative(Context context) context需要传入Activity对象
        TTAdNative mTTAdNative = TTAdManagerHolder.get().createAdNative(context);
        AdSlot adSlot = new AdSlot.Builder()
            .setCodeId("946073770") //广告位id
            .setSupportDeepLink(true)
            .setAdCount(3) //请求广告数量为1到3条
            .setExpressViewAcceptedSize(360,360) //期望模板广告view的size,单位dp
            .build();
        mTTAdNative.loadNativeExpressAd(adSlot, listener);
    }
}
